package com.yunbiao.ybbusstopplate.utils

import android.app.ProgressDialog
import android.content.Context
import com.yunbiao.ybbusstopplate.ui.dialog.LoadingDialog

class ProgressDialogUtils {
    companion object{
//        var progressDialog:ProgressDialog?=null
        var progressDialog:LoadingDialog?=null

        fun showProgressDialog(context: Context,msg:String){
            if (progressDialog!=null&& progressDialog!!.isShowing){
                progressDialog!!.dismiss()
                progressDialog=null
            }
//            progressDialog = ProgressDialog(context)
            progressDialog = LoadingDialog(context)
            progressDialog!!.setMessage(msg)
            progressDialog!!.show()
        }

        fun dismissProgressDialog(){
            if (progressDialog!=null&& progressDialog!!.isShowing){
                progressDialog!!.dismiss()
            }
        }

    }
}